package engine.display.guide
{
	import engine.data.ModelLocator;
	import engine.guide.GuideEvent;
	import engine.ui.lite.BaseUI;
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.text.NxInput;
	import newx.com.control.text.NxLabel;
	import newx.com.control.text.NxText;
	
	public class GuideUI extends BaseUI
	{
		public var jiantou:MovieClip;
		public var zhixiangjiatou:MovieClip;
		public var txt_info:NxText;
		public var npcFace:NxClip;
		public var txt_test:NxInput;
		public var bg_test:MovieClip;
		public var npcTalkBack:MovieClip;
		public var baseBG:MovieClip;
		public var guideSwf:NxClip;
		public var btn_test:NxButton;
		private var control:GuideLogic;
		private var _model:ModelLocator;
		
		public function GuideUI(popupUI:Boolean=true)
		{
			control = GuideLogic.getInstance();
			super(false);
		}
		
		override public function Init():void
		{
			_model = ModelLocator.getInstance();
			control.uiinit();
			btn_test.addEventListener(MouseEvent.CLICK,onClick)
		}
		
		private function onClick(e:MouseEvent):void
		{
			_model.dispatchEvent( new GuideEvent( GuideEvent.EXECUTE_GUILD, [ txt_test.text ] ) );
		}
		override protected function  BeforeShow():void
		{
			control.BeforeShow();
		}
		
		override protected function AfterHide():void
		{
			control.AfterHide();
		}
	}
}